home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / videoutils / a-g / ami2d / macros / genquad4.rexx < prev    next >
OS/2 REXX Batch file  |  1978-11-24  |  1KB  |  58 lines

  1. /* script to generate quad4's using existing nodes */
  2. options results
  3.  
  4. address ami2d
  5.  
  6. if ~show('l', "rexxmathlib.library") then do
  7.     check = addlib('rexxmathlib.library',0,-30,0)
  8. end
  9.  
  10. 'info'
  11. parse var result nnodes nelems nbcs
  12.  
  13. do n=1 to 3
  14.     'info(node)'
  15.     fn = result
  16.     parse var fn nd in junk
  17.     if in = 0 then exit
  18.     do m=1 to n-1
  19.         if in < i.m then do
  20.             do j=n-1 to m by -1
  21.                 j1 = j+1
  22.                 f.j1 = f.j
  23.                 i.j1 = i.j
  24.             end
  25.             leave
  26.         end
  27.     end
  28.     f.m = fn
  29.     i.m = in
  30. end
  31. parse var f.1 nd i1a x1a y1a
  32. parse var f.2 nd i1b x1b y1b
  33. parse var f.3 nd i2b x2b y2b
  34.  
  35. ni = i1b - i1a
  36.  
  37. 'get inodes'
  38. if length(result) > 0 then in = result%1 - 1
  39. else in = ni
  40. nj = (i2b - i1b)/(in + 1)
  41.  
  42. 'get jnodes'
  43. if length(result) > 0 then jn = result%1 - 1
  44. else jn = nj
  45.  
  46. 'get material'
  47. if length(result) > 0 then mid = result%1
  48. else mid = 1
  49.  
  50. do j=1 to nj
  51.     do i=1 to ni
  52.         n = i1a + (j - 1)*(in + 1) + i - 1
  53.         m = i1a + j*(in + 1) + i - 1
  54.         'quad4(0,'mid','n','n + 1','m + 1','m')'
  55.     end
  56. end
  57. exit
  58.